using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using Miris.HumanMilkAnalyser.DataModel;
using Miris.HumanMilkAnalyser.Repository.EntityFramework.Mapping;

namespace Miris.HumanMilkAnalyser.Repository.EntityFramework
{
    public partial class MirisHumanMilkAnalyserContext : DbContext
    {
        static MirisHumanMilkAnalyserContext()
        {
            Database.SetInitializer<MirisHumanMilkAnalyserContext>(null);
        }

        public MirisHumanMilkAnalyserContext()
            : base("Name=MirisHumanMilkAnalyserContext")
        {
        }

        public DbSet<AnalysisItem> AnalysisItems { get; set; }
        public DbSet<AnalysisResult> AnalysisResults { get; set; }
        public DbSet<AnalysisResultDiagnosticMessage> AnalysisResultDiagnosticMessages { get; set; }
        public DbSet<BreastfeedingSignificance> BreastfeedingSignificances { get; set; }
        public DbSet<DiagnosticMessageReference> DiagnosticMessageReferences { get; set; }
        public DbSet<Patient> Patients { get; set; }
        public DbSet<UnassignedSampleNumber> UnassignedSampleNumbers { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new AnalysisItemMap());
            modelBuilder.Configurations.Add(new AnalysisResultMap());
            modelBuilder.Configurations.Add(new AnalysisResultDiagnosticMessageMap());
            modelBuilder.Configurations.Add(new BreastfeedingSignificanceMap());
            modelBuilder.Configurations.Add(new DiagnosticMessageReferenceMap());
            modelBuilder.Configurations.Add(new PatientMap());
            modelBuilder.Configurations.Add(new UnassignedSampleNumberMap());
        }
    }
}
